﻿Imports Microsoft.VisualBasic

Public Class CConfig : Inherits CConfigBase

    Public Shared Function IsDev() As Boolean
        Return HttpContext.Current.Request.Url.Host.ToLower.Contains("localhost")
    End Function

    Public Shared Function Layout() As ELayout
        Dim s As String = Config("Layout", "Horizontal")
        Return CType([Enum].Parse(GetType(ELayout), s), ELayout)
    End Function
    Public Shared Function MenuTitle() As String
        Return Config("MenuTitle", "ControlTrack")
    End Function


	Public Shared Function SaasDb(Optional database As String = "controltracksaas") As CSqlClient
		Return New CSqlClient(ControlTrackSaas(database))
	End Function
	Public Shared Function ControlTrackSaas(Optional database As String = "controltracksaas") As String
		Return String.Concat("Server=tcp:controltracksaas.database.windows.net,1433;Initial Catalog=", database, ";Persist Security Info=False;User ID=controltracksaas@controltracksaas;Password=@6uik3JdRBri;MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;")
	End Function


End Class
